<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title>不良品查询-仓库-wms仓库管理系统</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;top: 0px;">

    <!-- start sp-wrapper -->
    <link rel="stylesheet" href="/sb/stock.css"/>
    <div class="sp-wrapper">
        <h2 class="sp-title"><span>不良品查询</span></h2>
        <div class="sp-tool">
            <form action="/goods_bad_stock/list" method="get">
                <span class="fl">
                    <b><input type="text" name="number" id="str" placeholder="输入商品SKU进行查询" style="width: 200px;"></b>
                    <b>
<!--                        <select name="type">-->
<!--                            <option value="">请选择类型</option>-->
<!--                            <option value="1">退货商品</option>-->
<!--                            <option value="2">不良品</option>-->
<!--                        </select>-->
                    </b>
                    <input type="submit" class="button" value="查询">
                    <b>总共：&nbsp;[[${totalSize}]]&nbsp;条记录</b>
                    </b>
                </span>
                <!--<span class="fr"><a href="/goods_bad_stock/add" class="add">新增</a></span>-->
            </form>
        </div>
        <div class="sp-table" >
            <table>
                <thead>
                <tr>
                    <th>ID</th>
                    <th>商品</th>
                    <th>规格</th>
                    <th>SKU</th>
                    <th>类型</th>
                    <th>原始单据号</th>
                    <th>数量</th>
                    <th>原因</th>
                    <th>处理结果</th>
                    <th>状态</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="item:${lists}">
                    <td th:text="${item.id}"></td>
                    <td th:text="${item.goodsName}">10000</td>
                    <td >
                        颜色：[[${item.colorValue}]]&nbsp;尺码：[[${item.sizeValue}]]
                    </td>
                    <td th:text="${item.specNumber}">新款连衣裙2019</td>
                    <td >
                        <b th:if="${item.type==1}">报损</b>
                        <b th:if="${item.type==2}">退货</b>
                    </td>
                    <td th:text="${item.sourceId}">1000</td>
                    <td th:text="${item.quantity}">1000</td>
                    <td th:text="${item.reason}">1000</td>
                    <td th:text="${item.result}">1000</td>
                    <td >
                        <b th:if="${item.status==0}">未处理</b>
                        <b th:if="${item.status==1}">已处理</b>
                    </td>
                    <td  th:text="${item.createTime }"></td>
                    <td>
<!--                        <i class="detail" th:attr="data-id=${item.id}">查看明细</i>-->
                        <i class="stock_in" th:if="${item.status==0}" th:attr="data-id=${item.id}">入库</i>
                        <i class="stock_loss" th:if="${item.status==0}" th:attr="data-id=${item.id}">报废</i>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="pages">
            <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
        </div>
    </div>

    <script type="text/javascript" src="/sb/jquery.min.js"></script>
    <script type="text/javascript" src="/sb/Tips.min.js"></script>
    <script type="text/javascript">
        layui.use(['laydate', 'layer'], function () {
            var laydate = layui.laydate;
            var layer = layui.layer;

            $(".detail").click(function () {
                var id = $(this).attr("data-id");
                //iframe层
                layer.open({
                    type: 2,
                    title: '详情',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['940px', '90%'],
                    content: '/goods_bad_stock/detail?id=' + id //iframe的url
                });
            });

            $(".stock_in").click(function () {
                var id = $(this).attr("data-id");
                layer.msg("还未实现");
            });
            $(".stock_loss").click(function () {
                var id = $(this).attr("data-id");
                layer.msg("还未实现");
            });
        });
    </script>
    <!-- end sp-wrapper -->

</div>
</body>
<html>
